<?xml version="1.0" encoding="UTF-8" ?>
<%@page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="css/report.css" />
<title></title>
<style type="text/css">
	@page {
		margin: 10px;
	<%
    	if (!request.getParameter("orientacion").equals("0")) {
	%>
  			size: landscape;
	<%
    	}
	%>
    }
</style>
</head>
<body>
     <%@page import="java.util.HashMap" %>
     <%@page import="java.util.Vector" %>
     <%@page import="util.Executor" %>
     <%@page import="util.DFormat" %>

     <%@page import="managers.MngCompanies" %>
     <%@page import="business.Company" %>
     <%@page import="util.JDate" %>
     <%@page import="business.Current" %>
     <%
        MngCompanies MngCmpis = new MngCompanies();
        Company company = MngCmpis.getCompany(Current.company);
        String empresa = company.getName();

        JDate now = new JDate();

        String fyh = "<label>" +
                          "<span>Fecha Imp.:</span> " + now.getDate() +
                     "</label>" +
                     "<label>" +
                        "<span>Hora Imp.:</span>" + now.getTime().substring(11, 16) +
                     "</label>";

        String report = request.getParameter("report");

        if (report.equals("estructura")) {
        	String tipo = request.getParameter("tipo");
%>
        	<%@page import="managers.MngEstructura" %>
			<div style="width: 50%; margin: 0 auto;">
				<table width="100%">
	                <thead>
	                <tr>
	                    <td width="33%"><%= empresa %></td>
	                    <td align="center">
	                        <div class="dvTitle">
                                <h3><%= request.getParameter("title").toUpperCase() %></h3>
	            			</div>
	                    </td>
	                    <td width="33%" align="right"><%= fyh %></td>
	                </tr>
	                </thead>
	            </table>
	            <table width="100%" cellspacing="0" class="breport">
	            	<thead>
	            		<tr>
	            			<th>Código</th>
	            			<th>Descripción</th>
	            		</tr>
	            	</thead>
	            	<tbody><%= new MngEstructura().getRptTable(tipo) %></tbody>
	            </table>
	         </div>
<%
   		}

        if (report.equals("tallas")) {
%>
        	<%@page import="managers.MngTallas" %>
			<div style="width: 75%; margin: 0 auto;">
				<table width="100%">
	                <thead>
	                <tr>
	                    <td width="33%"><%= empresa %></td>
	                    <td align="center">
	                        <div class="dvTitle">
                                <h3><%= request.getParameter("title").toUpperCase() %></h3>
	            			</div>
	                    </td>
	                    <td width="33%" align="right"><%= fyh %></td>
	                </tr>
	                </thead>
	            </table>
	            <table width="100%" cellspacing="0" class="breport">
	            	<thead>
	            		<tr>
	            			<th>Talla</th>
	            			<th>T01</th><th>T02</th><th>T03</th><th>T04</th><th>T05</th>
                            <th>T06</th><th>T07</th><th>T08</th><th>T09</th><th>T10</th>
	            		</tr>
	            	</thead>
                    <tbody><%= MngTallas.getTable(true) %></tbody>
	            </table>
	         </div>
<%
   		}

        if (report.equals("articulos")) {
%>
            <%@page import="managers.MngArticulos" %>
            <div style="width: 90%; margin: 0 auto;">
				<table width="100%">
	                <tr>
	                    <td width="33%"><%= empresa %></td>
	                    <td align="center">
	                        <div class="dvTitle">
                                <h3><%= request.getParameter("title").toUpperCase() %></h3>
	            			</div>
	                    </td>
	                    <td width="33%" align="right"><%= fyh %></td>
	                </tr>
	            </table>
	            <table width="100%" cellspacing="0" class="breport">
	            	<thead>
	            		<tr>
                            <th>Código</th> <th>Descripción</th>
                            <th>Marca</th> <th>T.Prenda</th> <th>Modelo</th> <th>T.Tela</th> <th>Género</th>
                            <th>IDTAL</th> <th>P.MAY(6)</th> <th>P.MAY(3)</th> <th>P.VTA</th>
                        </tr>
	            	</thead>
                    <tbody><%= MngArticulos.getTable(true) %></tbody>
	            </table>
	         </div>
<%

        }
%>
</body>
</html>